<template>
	
	<view class="content">
	    <ad-rewarded-video adpid="1507000689" :loadnext="true" v-slot:default="{loading, error}" @load="onadload" @close="onadclose" @error="onaderror">
	      <button :disabled="loading" :loading="loading">显示广告</button>
	      <view v-if="error">{{error}}</view>
	    </ad-rewarded-video>
	  </view>
</template>

<script>
	export default {
	  data() {
	    return {
	    }
	  },
	  methods: {
	    onadload(e) {
	      console.log('广告数据加载成功');
	    },
	    onadclose(e) {
	      const detail = e.detail
	      // 用户点击了【关闭广告】按钮
	      if (detail && detail.isEnded) {
	        // 正常播放结束
	        console.log("onadclose " + detail.isEnded);
	      } else {
	        // 播放中途退出
	        console.log("onadclose " + detail.isEnded);
	      }
	    },
	    onaderror(e) {
	      // 广告加载失败
	      console.log("onaderror: ", e.detail);
	    }
	  }
	}
</script>

<style scoped>
	.content {
		height:100%;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}

    .nvue-page-root {
        background-color: #F8F8F8;
        padding-bottom: 20px;
    }

    .page-title {
        /* #ifndef APP-NVUE */
        display: flex;
        /* #endif */
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: 35rpx;
    }

    .page-title__wrapper {
        padding: 0px 20px;
        border-bottom-color: #D8D8D8;
        border-bottom-width: 1px;
    }

    .page-title__text {
        font-size: 16px;
        height: 48px;
        line-height: 48px;
        color: #BEBEBE;
    }

    .title {
        padding: 5px 13px;
    }

    .uni-form-item__title {
        font-size: 16px;
        line-height: 24px;
    }

    .uni-input-wrapper {
        /* #ifndef APP-NVUE */
        display: flex;
        /* #endif */
        padding: 8px 13px;
        flex-direction: row;
        flex-wrap: nowrap;
        background-color: #FFFFFF;
    }

    .uni-input {
        height: 28px;
        line-height: 28px;
        font-size: 15px;
        padding: 0px;
        flex: 1;
        background-color: #FFFFFF;
    }

    .uni-icon {
        font-family: uniicons;
        font-size: 24px;
        font-weight: normal;
        font-style: normal;
        width: 24px;
        height: 24px;
        line-height: 24px;
        color: #999999;
    }

    .uni-eye-active {
        color: #007AFF;
    }
	button {
	    margin-top: 10rpx;
	    margin-bottom: 10rpx;
		margin-left: 35rpx;
		
	}
	
	.button-sp-area {
	    margin: 0 auto;
	    width: 60%;
	}
	
	
</style>
